avoid combining multiple words provided to trust/untrust/dead
authorJoey Hess <joeyh@joeyh.name>
Mon, 3 Oct 2022 17:48:40 +0000 (13:48 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 3 Oct 2022 17:48:40 +0000 (13:48 -0400)
commit15f9fcbcb10d8ab61f74b8824cbfd52afca87b72
treeebe1f348f6dabe29c444e7e07f4421f53088d8aa
parent99e4dc8d41c36e04582eed4ad20f8c2a90473a4e
avoid combining multiple words provided to trust/untrust/dead

* trust, untrust, semitrust, dead: Fix behavior when provided with
  multiple repositories to operate on.
* trust, untrust, semitrust, dead: When provided with no parameters,
  do not operate on a repository that has an empty name.

The man page and usage already indicated that multiple repos could be
provided to these commands, but they actually used unwords to combine
everything into string, and found a repo matching that string. This was
especially bad when no parameters resulted in the empty string and some
repo happened to have an empty description.

This does change the behavior, and it's possible someone relied on the
current behavior to eg, trust a repo by name with the name not quoted into
a single parameter. But fixing the empty string bug and matching the
documentation are worth breaking that usage.

Note that git-annex init/reinit do still unwords multiple parameters when
provided to them. That is inconsistent behavior, but it certianly seems
possible that something does run git-annex init with an unquoted
description, and I don't think it's worth breaking that just to make it more
consistent with these other commands.

Sponsored-by: Boyd Stephen Smith Jr. on Patreon
CHANGELOG
Command/Trust.hs
doc/bugs/dead_with_no_params_can_mark_repo_with_empty_description_dead.mdwn